import React from 'react';
/**
 * 加载样式文件
 * */
import './UploadImg.scss';


export default class UploadImg extends React.Component {
    render() {

        return (
            <div className="attach-container" id={this.props.id}
                 style={{
                     width: this.props.boxWidth,
                     height: this.props.boxHeight
                 }}>
                {
                    this.props.loadingVisible ? (<div className="progress"> </div>) : ""
                }
                <input id="imgFile" className="imgFile" onChange={ this.props.fileChange } type="file"
                       name="userAvatar"/>
                <img src={ this.props.imgSrc || this.props.buttonBg } alt=""/>
            </div>
        );
    }
}

